<template>
  <div class="home">
    <!-- <img alt="Vue logo" src="../assets/touxiang.png"> -->
    <Person :name="myName" @gaibianUser="getUser"></Person> 
    <HelloWorld msg="Welcome to My Vue.js App"/>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import Person from '../components/Person.vue'
export default {
  name: 'home',
  data(){
    return {
      myName:'Mozpd' //父组件向子组件传值
    }
  },
  methods:{
    getUser(msg){
      this.myName = msg // 子组件向父组件传值
    }
  },
  components: {
    HelloWorld,
    Person
  }
}
</script>
